export const state = () => ({
  scrollTop: 0
})

export const mutations = {
  M_UPDATE_SCROLLTOP(state, payload) {
    state.scrollTop = payload
  }
}

export const actions = {
  nuxtServerInit(store, { $cookies }) {
    console.log("nuxtServerInit");
    const token = $cookies.get('token')
    if (token) {
      store.commit('user/M_UPDATE_TOKEN', token)
    }
  }
}